package com.example.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * 
 * @TableName user
 */
@TableName(value ="user")
@Data
public class User implements Serializable {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户编号
     */
    @TableField(value = "indetifier")
    private Integer indetifier;

    /**
     * 用户姓名
     */
    @TableField(value = "username")
    private String username;

    /**
     * 密码
     */
    @TableField(value = "password")
    private String password;

    /**
     * 手机号码
     */
    @TableField(value = "tel")
    private String tel;

    /**
     * 用户类型，“1”学生 ‘2’用工部门  ‘3’辅导员  ‘4’部门审核   ”5“系统管理员
     */
    @TableField(value = "role")
    private String role;

    /**
     * 用户状态，“1”正常   "0"禁用
     */
    @TableField(value = "status")
    private String status;

    /**
     * 邮箱
     */
    @TableField(value = "email")
    private String email;

    /**
     * 学校
     */
    @TableField(value = "school")
    private String school;

    /**
     * 是否是贫困生，1是 0不是
     */
    @TableField(value = "isPoor")
    private Integer isPoor;

    /**
     * 贫困生证明材料
     */
    @TableField(value = "poorFile")
    private String poorFile;

    /**
     * 注册时间
     */
    @TableField(value = "created_time")
    private LocalDateTime createdTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_tiem")
    private LocalDateTime updateTiem;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        User other = (User) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getIndetifier() == null ? other.getIndetifier() == null : this.getIndetifier().equals(other.getIndetifier()))
            && (this.getUsername() == null ? other.getUsername() == null : this.getUsername().equals(other.getUsername()))
            && (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword()))
            && (this.getTel() == null ? other.getTel() == null : this.getTel().equals(other.getTel()))
            && (this.getRole() == null ? other.getRole() == null : this.getRole().equals(other.getRole()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail()))
            && (this.getSchool() == null ? other.getSchool() == null : this.getSchool().equals(other.getSchool()))
            && (this.getIsPoor() == null ? other.getIsPoor() == null : this.getIsPoor().equals(other.getIsPoor()))
            && (this.getPoorFile() == null ? other.getPoorFile() == null : this.getPoorFile().equals(other.getPoorFile()))
            && (this.getCreatedTime() == null ? other.getCreatedTime() == null : this.getCreatedTime().equals(other.getCreatedTime()))
            && (this.getUpdateTiem() == null ? other.getUpdateTiem() == null : this.getUpdateTiem().equals(other.getUpdateTiem()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getIndetifier() == null) ? 0 : getIndetifier().hashCode());
        result = prime * result + ((getUsername() == null) ? 0 : getUsername().hashCode());
        result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode());
        result = prime * result + ((getTel() == null) ? 0 : getTel().hashCode());
        result = prime * result + ((getRole() == null) ? 0 : getRole().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getEmail() == null) ? 0 : getEmail().hashCode());
        result = prime * result + ((getSchool() == null) ? 0 : getSchool().hashCode());
        result = prime * result + ((getIsPoor() == null) ? 0 : getIsPoor().hashCode());
        result = prime * result + ((getPoorFile() == null) ? 0 : getPoorFile().hashCode());
        result = prime * result + ((getCreatedTime() == null) ? 0 : getCreatedTime().hashCode());
        result = prime * result + ((getUpdateTiem() == null) ? 0 : getUpdateTiem().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", indetifier=").append(indetifier);
        sb.append(", username=").append(username);
        sb.append(", password=").append(password);
        sb.append(", tel=").append(tel);
        sb.append(", role=").append(role);
        sb.append(", status=").append(status);
        sb.append(", email=").append(email);
        sb.append(", school=").append(school);
        sb.append(", isPoor=").append(isPoor);
        sb.append(", poorFile=").append(poorFile);
        sb.append(", created_time=").append(createdTime);
        sb.append(", update_tiem=").append(updateTiem);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        sb.append("\n");
        return sb.toString();
    }
}